package terra.model.object.action;

import java.io.Serializable;

import terra.model.object.ai.AbstractAI;

public abstract class AbstractAction implements Serializable {

	private static final long serialVersionUID = 4372618483237413300L;
	public byte id;
	public AbstractAI ai;
	public boolean normal = true;
	public boolean interrupted = false;
	public boolean ended = false;

	public AbstractAction(byte actionId, AbstractAI ai) {
		id = actionId;
		this.ai = ai;
	}

	public void interrupt() {
		interrupted = true;
		ended = true;
		ai.setPreviousAction(this);
	}

	public void end() {
		ended = true;
		ai.setPreviousAction(this);
		// System.out.println("action ended " + this);
	}

	public abstract void update(int delta);

}
